﻿namespace RuoYi.Framework.Authentication.OAuth
{
    /// <summary>
    /// Authentication (认证)
    /// 作用：验证用户身份，确认"你是谁"。
    /// </summary>
    public class OAuthAuthenticationErrCodeModel
    {
        public string error { get; set; }

        public string error_description { get; set; }

        public static void VerifyErrResponse(string content)
        {

            var model = Newtonsoft.Json.JsonConvert.DeserializeObject<OAuthAuthenticationErrCodeModel>(content);
            if (model.error != null)
            {

                throw new Exception($"第三方授权返回错误，错误码：【{model.error}】，错误详情：【{model.error_description}】");
            }
        }
    }
}
